<?php 
class Application_Model_{$controller->controller_name}{
    {$tablesDb = array() }
    {foreach $actions as $action}{foreach $action->forms as $form}{$query = $form->query}{if isset($query.table.table_class)} 
        {if !in_array($query.table.table_class, $tablesDb)}
            {$tablesDb[] = $query.table.table_class}
        {/if}
    {/if}{/foreach}{/foreach}
    
    {foreach $tablesDb as $table}
        /**
        * @var Application_Model_{$table}
        */
        private $_modelDb{$table};
    {/foreach}
    
    /**
    * Constructure
    * @author auto
    */
    public function __construct($options = array()){
        {foreach $tablesDb as $table}
            $this->_modelDb{$table} = new Application_Model_DbTable_{$table}();
        {/foreach}
    }
    
    {foreach $actions as $action}
    /**
    * function {$action->action_type_name}
    * @author: auto
    * @param: array $params
    * @return array
    */
    public function {$action->action_type_name}($params = array()){
        $result = array();
        {foreach $action->forms as $form}
            {$template = $form->form_type_model}
            {include file="$template_path/$template.tpl"}
            
        {/foreach}
        return $result;
    }
    {/foreach}
}